package com.langyue.recordmanage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.langyue.recordmanage.model.vo.UserVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description:
 * @Author: wanglang
 * @CreateTime: 2022/4/11
 * @Company:
 */
@Repository("UserVoMapper")
public interface UserVoMapper {
    @Select("SELECT * FROM user u left join teacher t on 1=1 left join student s on 1=1 WHERE (u.user_type=1 or (u.user_type=2 and u.user_id=t.id) or (u.user_type=3 and u.user_id=s.id)) limit #{pageOffset},#{pageSize};")
    List<UserVo> selectUserVoById(@Param("pageOffset") Integer pageOffset,@Param("pageSize") Integer pageSize);
}
